package TGA.DB2.Infra;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;


public class Hibernate {
	
	private static EntityManager ctx;
	
	public static EntityManager getContext(){
		if(ctx != null) return ctx;
		
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("BD2");
		ctx = emf.createEntityManager();
		return ctx;
	}
}
